package com.jindun.paper.ui.handler;

import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.ui.PlatformUI;

import com.jindun.paper.ui.setting.SettingEditorDialog;
import com.jindun.paper.ui.setting.SettingListView;

public class SettingAddHandler extends AbstractHandler {

	@Override
	public Object execute(ExecutionEvent event) throws ExecutionException {
		
		SettingEditorDialog dialog = new SettingEditorDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow(), null);
		if (dialog.open() == Dialog.OK) {
			SettingListView settingListView = (SettingListView)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("settingListView");
			settingListView.refresh();
		}

		
		return null;
	}

	

}
